package me.zhengjie.sqlservice.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import me.zhengjie.mapper.WcsDeliveryMissionHistoryMapper;
import me.zhengjie.pojo.entity.WcsDeliveryMissionHistory;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class WcsDeliveryMissionHistoryService extends ServiceImpl<WcsDeliveryMissionHistoryMapper, WcsDeliveryMissionHistory> implements me.zhengjie.sqlservice.WcsDeliveryMissionHistoryService {
    private final WcsDeliveryMissionHistoryMapper wcsDeliveryMissionHistoryMapper;

    @Override
    public boolean insertDeliveryHistory(WcsDeliveryMissionHistory wcsDeliveryMissionHistory) {
        return wcsDeliveryMissionHistoryMapper.insert(wcsDeliveryMissionHistory) >0;
    }

    @Override
    public WcsDeliveryMissionHistory selectContainerCode(Integer palletCode) {
        LambdaQueryWrapper<WcsDeliveryMissionHistory> wcsDeliveryMissionHistoryLambdaQueryWrapper = new LambdaQueryWrapper<>();
        wcsDeliveryMissionHistoryLambdaQueryWrapper.eq(WcsDeliveryMissionHistory::getContainerCode,palletCode);
        return wcsDeliveryMissionHistoryMapper.selectOne(wcsDeliveryMissionHistoryLambdaQueryWrapper);
    }
}
